package jp.sourceforge.akjrcp.util;

import jp.sourceforge.akjrcp.commons.ui.AbstractFileDirChoicer.FileStatusChangeEvent;
import jp.sourceforge.akjrcp.commons.ui.AbstractFileDirChoicer.FileStatusChangeListener;

public abstract class ExecutingControlerView extends ParamCompositeBuilderView{
	protected Executer executer;
	
	public abstract void doAfterExecute();
	public abstract void doBeforeExecute();
	public abstract boolean doCanExecute();
	public abstract void doCancelExecute();
	public abstract void doInExecute();
	public ExecutingControlerView(){
		super();
		executer=new Executer();
	}
	public class Executer extends ExecutingControler{
		
		public void afterExecute() {
			doAfterExecute();
		}

		public void beforeExecute() {
			doBeforeExecute();
		}

		public boolean canExecute() {
			return doCanExecute();
		}

		public void cancelExecuting() {
			doCancelExecute();
			
		}


		public void inExecute() {
			doInExecute();
		}
		
		
	}
	

	public class FileSelected implements FileStatusChangeListener{

		public void addList(FileStatusChangeEvent event) {
			
			executer.updateControlSwitch();
		}

		public void removeList(FileStatusChangeEvent event) {
			executer.updateControlSwitch();
		}
		
	}
}
